package com.putao.album.widget.pttag;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ToggleButton;

import com.putao.album.R;
import com.putao.album.util.Loger;

public class PtTagView extends ToggleButton {

    private boolean mCheckEnable = true;

    public PtTagView(Context paramContext) {
        super(paramContext);
        init();
    }

    public PtTagView(Context paramContext, AttributeSet paramAttributeSet) {
        super(paramContext, paramAttributeSet);
        init();
    }

    public PtTagView(Context paramContext, AttributeSet paramAttributeSet,
                     int paramInt) {
        super(paramContext, paramAttributeSet, 0);
        init();
    }

    private void init() {
        setTextOn(null);
        setTextOff(null);
        setText("");
        setBackgroundResource(R.drawable.tag_bg);
    }

    public void setNewBackgroundResource(int resId) {
        setBackgroundResource(resId);
    }

    public void setCheckEnable(boolean paramBoolean) {
        this.mCheckEnable = paramBoolean;
        if (!this.mCheckEnable) {
            super.setChecked(false);
        }
    }

    public void setChecked(boolean paramBoolean) {
        if (this.mCheckEnable) {
            super.setChecked(paramBoolean);
        }
    }
}
